<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<div class="modal-dialog x-modal-dialog" style="width: 600px;">

  <div class="modal-content">

    <div class="modal-header x-breadcrumb clearfix">

      <h2><i class="glyphicon glyphicon-fire" title=""></i>&nbsp;&nbsp;<span>批量公出</span></h2>

      <button type="button" class="close" data-dismiss="modal">&times;</button>

    </div>

    <form class="form-horizontal" method="POST" action="${ctx.host}/schedules/batch-business-calendar" data-validate = "true">

      <input type="hidden" name="_method" value="PATCH">
      <div class="modal-body">
      
        <div class="form-group x-form-group">
          <label class="col-xs-3 control-label">教练</label>
          <div class="col-xs-7">
<%--        <select name="coaches" class="form-control select2" data-validate = "required" multiple>
              <option></option>
              <c:forEach var="principal" items="${persist.principals}">
                <c:if test="${principal.coach && not principal.disabled}">
                  <option value = "${principal.id}">${principal.name}</option>
                </c:if>
              </c:forEach>
            </select> --%>
            <div class="row">
            <c:forEach var="principal" items="${persist.principals}">
              <c:if test="${principal.coach && not principal.disabled}">
               <div class="col-xs-4" >
                <label class="checkbox-inline" >
			      <input type="checkbox" name="coaches" value="${principal.id}"> ${principal.name}
			    </label>
			   </div> 
			  </c:if>
			</c:forEach>
			</div>
			
          </div>

        </div>
        
        <div class="form-group x-form-group">
          
          <label class="col-xs-3 control-label">日期</label>
          <div class="col-xs-7">
            <input type="text" class="form-control date" placeholder="请选择日期" name="date" value="" readOnly/>
          </div>
        </div>
      
        <div class="form-group x-form-group">
          <label class="col-xs-3 control-label">时间</label>
          <div class="col-xs-7" >
            <c:set var="businessCalendars" value=""/>
            <select name="hour" class="form-control select2" data-validate = "required" multiple>
              <option></option>
              <c:forEach var="hour" items="${persist.allTimes}">
                <option value = "${hour}">${hour}</option>
              </c:forEach>
            </select>
          </div>

        </div>
        
      </div>

      <div class="modal-footer">
        <button type="submit" class="btn btn-success btn-shadow btn-shadow-success x-btn">确定</button>&nbsp;&nbsp;&nbsp;&nbsp;
        <button type="button" class="btn btn-default btn-shadow btn-shadow-default x-btn" data-dismiss="modal">取消</button>
      </div>

    </form>

  </div>

</div>

<script type="text/javascript">
  $(function() {
    
    $('.select2').select2({
      placeholder : '请选择',
      minimumResultsForSearch : -1,
      allowClear : true,
      width: '100%'
     });
    
    $('.date').datetimepicker({
        format: 'yyyy-mm-dd',
        autoclose: true,
        language: 'zh-CN',
        todayBtn: 'linked',
        todayHighlight: true,
        pickerPosition: 'bottom-right',
        minView: 'month',
        startDate: new Date()
      })
  })
</script>
